Create Single Task Agent
curl --request POST \
--url https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"agent_role": "<string>",
"agent_instructions": "<string>",
"tool": "<string>",
"examples": "<string>",
"features": [
{
"type": "<string>",
"config": {},
"priority": 123
}
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "<string>",
"model": "<string>",
"top_p": 123,
"temperature": 123
}
'import requests
url = "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task"
payload = {
"name": "<string>",
"description": "<string>",
"agent_role": "<string>",
"agent_instructions": "<string>",
"tool": "<string>",
"examples": "<string>",
"features": [
{
"type": "<string>",
"config": {},
"priority": 123
}
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "<string>",
"model": "<string>",
"top_p": 123,
"temperature": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
agent_role: '<string>',
agent_instructions: '<string>',
tool: '<string>',
examples: '<string>',
features: [{type: '<string>', config: {}, priority: 123}],
tool_usage_description: '<string>',
llm_credential_id: '<string>',
response_format: {},
provider_id: '<string>',
model: '<string>',
top_p: 123,
temperature: 123
})
};
fetch('https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'agent_role' => '<string>',
'agent_instructions' => '<string>',
'tool' => '<string>',
'examples' => '<string>',
'features' => [
[
'type' => '<string>',
'config' => [
],
'priority' => 123
]
],
'tool_usage_description' => '<string>',
'llm_credential_id' => '<string>',
'response_format' => [
],
'provider_id' => '<string>',
'model' => '<string>',
'top_p' => 123,
'temperature' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 67890,
"message": "Single task agent created successfully."
}Create Single Task Agent
Creates a new agent specifically for a single-task operation.
POST
/
agents
/
template
/
single-task
Create Single Task Agent
curl --request POST \
--url https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"agent_role": "<string>",
"agent_instructions": "<string>",
"tool": "<string>",
"examples": "<string>",
"features": [
{
"type": "<string>",
"config": {},
"priority": 123
}
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "<string>",
"model": "<string>",
"top_p": 123,
"temperature": 123
}
'import requests
url = "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task"
payload = {
"name": "<string>",
"description": "<string>",
"agent_role": "<string>",
"agent_instructions": "<string>",
"tool": "<string>",
"examples": "<string>",
"features": [
{
"type": "<string>",
"config": {},
"priority": 123
}
],
"tool_usage_description": "<string>",
"llm_credential_id": "<string>",
"response_format": {},
"provider_id": "<string>",
"model": "<string>",
"top_p": 123,
"temperature": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
agent_role: '<string>',
agent_instructions: '<string>',
tool: '<string>',
examples: '<string>',
features: [{type: '<string>', config: {}, priority: 123}],
tool_usage_description: '<string>',
llm_credential_id: '<string>',
response_format: {},
provider_id: '<string>',
model: '<string>',
top_p: 123,
temperature: 123
})
};
fetch('https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'agent_role' => '<string>',
'agent_instructions' => '<string>',
'tool' => '<string>',
'examples' => '<string>',
'features' => [
[
'type' => '<string>',
'config' => [
],
'priority' => 123
]
],
'tool_usage_description' => '<string>',
'llm_credential_id' => '<string>',
'response_format' => [
],
'provider_id' => '<string>',
'model' => '<string>',
'top_p' => 123,
'temperature' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"agent_instructions\": \"<string>\",\n \"tool\": \"<string>\",\n \"examples\": \"<string>\",\n \"features\": [\n {\n \"type\": \"<string>\",\n \"config\": {},\n \"priority\": 123\n }\n ],\n \"tool_usage_description\": \"<string>\",\n \"llm_credential_id\": \"<string>\",\n \"response_format\": {},\n \"provider_id\": \"<string>\",\n \"model\": \"<string>\",\n \"top_p\": 123,\n \"temperature\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 67890,
"message": "Single task agent created successfully."
}Endpoint:
POST/v3/agents/template/single-task
Description:
Creates a new agent specifically for a single-task operation.Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
| x-api-key | String | Yes | API key for authentication |
| accept | String | Yes | Expected response format (application/json) |
| content-type | String | Yes | Format of request body (application/json) |
Request Body:
{
"name": "string",
"description": "string",
"agent_role": "string",
"agent_instructions": "string",
"examples": "string",
"features": [
{
"type": "string",
"config": {},
"priority": 0
}
],
"tool": "string",
"tool_usage_description": "string",
"llm_credential_id": "string",
"response_format": {},
"provider_id": "string",
"model": "string",
"top_p": 0,
"temperature": 0
}
Request Example (cURL):
curl -X POST "https://agent-prod.studio.lyzr.ai/v3/agents/template/single-task" ^
-H "accept: application/json" ^
-H "content-type: application/json" ^
-H "x-api-key: sk-default-XXXXXXX" ^
-d "{\"name\":\"string\",\"description\":\"string\",\"agent_role\":\"string\",\"agent_instructions\":\"string\",\"examples\":\"string\",\"features\":[{\"type\":\"string\",\"config\":{},\"priority\":0}],\"tool\":\"string\",\"tool_usage_description\":\"string\",\"llm_credential_id\":\"string\",\"response_format\":{},\"provider_id\":\"string\",\"model\":\"string\",\"top_p\":0,\"temperature\":0}"
Authorizations
Body
application/json
Show child attributes
Show child attributes
⌘I